Living Worlds

GPU-Accelerated Terrain Simulation

CS380 Final Presentation

Mohammad Alkhalifah
December 2025

The Problem

Static Terrain is Boring

  • Traditional approach: Offline generation or manual sculpting
  • Games need: Dynamic, evolving worlds

Our Goal

Real-time terrain simulation using GPU cellular automata
with interactive framerates

What We Built

Living Worlds Engine

Component Description
Geological Layer Thermal erosion simulation
Ecological Layer 9 biome types with spreading rules
Feedback Loop Forests stabilize terrain (80% resistance)
Renderer 2.5D isometric with atmospheric fog

GPU Architecture

Data Flow

Heightmap A ──► Erosion ──► Heightmap B
    ↑                          │
    └────── Ping-Pong ─────────┘

Biome A ────► Biome CA ──► Biome B
    ↑                          │
    └────── Ping-Pong ─────────┘

Why Ping-Pong?

  • Prevents race conditions in parallel updates
  • Each frame: Read A → Write B → Swap
  • Essential for cellular automata correctness

Cellular Automata Rules

Thermal Erosion

Physical Process: mass flows downhill if slope > threshold

if (h - neighborH > threshold) {
    // Transfer mass downhill
    newHeight = h - erosionRate;
}

Feedback

Coupling: Biomes modify physical parameters

if (biome == FOREST) 
    erosionRate *= 0.2; 
    // 80% reduction

Biome Spreading

Stochastic CA: Random transitions based on neighbors

if (isGrass && forestNeighbors >= 3) {
    if (random() < 0.3) 
        convertToList(FOREST);
}

Why Compute Shaders?

  • Massively Parallel: 3072² cells = 9.4M threads
  • Local Rules: No global dependencies (perfect for GPU)

Biome System

9 Discrete Biome Types

Biome Behavior
🌊 Water Height < 0.3 (forced)
🏖️ Sand Coastal zones
🌱 Grass Default land, converts to forest
🌲 Forest Spreads, resists erosion
🏜️ Desert Spreads in dry areas
🪨 Rock High elevation (>0.8)
❄️ Snow Peaks (>0.85)
🏔️ Tundra Alpine transition
💧 Wetland Low areas near water

Performance Results

Benchmark: FPS vs Grid Size

Grid Vertices FPS
512² 262K 3,062
1024² 1.0M 1,414
2048² 4.2M 505
3072² 9.4M 243

Scalability Analysis

FPS vs Simulation Speed

Key Findings

  • FPS decreases linearly with compute load
  • 1000× sim speed costs ~30% FPS
  • Interactive performance maintained

Demo Video

One-Minute Walkthrough

Demonstrating terrain generation, camera control, biome spawning, and erosion dynamics.

(Video plays here)

Future Work

  • Hydraulic erosion - water flow simulation
  • GPU tessellation - level of detail
  • Infinite terrain - chunked streaming
  • Advanced lighting - shadows, ambient occlusion

Thank You!

Questions?

Repository:
github.com/mkhlf/livingworlds

Slide 6: Reduced font size for table fit